set textsource to open for access file (thefile) --open the file with the digest in it
set thetext to read textsource from 1 -- read the entire file into theBody
close access textsource --close the file
on error errString number errNum
return -1
display dialog errString & " " & errNum
end try
--check to see if body is too long, if so truncate
set theheader to (count of characters in (intro & s9mailsubject & bodyintro)) + 1
if ((count of characters in thetext) + theheader) is greater than maxlength then set thetext to (characters 1 through (maxlength - theheader) of thetext)
--if subscriber is known, page him
if ((s9mailsubject is in (subscriber names)) or (s9mailsubject is in (group names))) then
send page thetext as string to s9mailsubject as string
else --else subscriber is not known, so reply and say so
tell application "ListSTAR Server"
StarNine Send ¬
"PageNOW!" To s9SenderEmailAddress ¬
Subject s9mailsubject & ¬
" is not a known subscriber or group" Body s9mailsubject & " is not a known subscriber or group. For a complete listing, send mail to \"" & serviceEmailAddress & "\" with the word \"subscribers\" in the subject." & return & return & "Original text of page follows:" & return & return & thetext